var dbody = document.body;
//创建链接 
function createA(url, text) {
	var a = document.createElement("a");
	a.href = url;
	a.innerHTML = text;
	a.style.color = "red";
	dbody.appendChild(a);
}

//创建DIV 
function createDIV(text) {
	var div = document.createElement("div");
	div.innerHTML = text;
	dbody.appendChild(div);
}

//创建表单项 
function createInput(sType, sValue) {
	var input = document.createElement("input");
	input.type = sType;
	input.value = sValue;
	dbody.appendChild(input);
}

//创建表格 
function createTable(w, h, r, c) {
	var table = document.createElement("table");
	var tbody = document.createElement("tbody");
	table.width = w;
	table.height = h;
	table.border = 1;
	for(var i = 1; i <= r; i++) {
		var tr = document.createElement("tr");
		for(var j = 1; j <= c; j++) {
			var td = document.createElement("td");
			td.innerHTML = i + "" + j;
			//td.appendChild(document.createTextNode(i + "" + j)); 
			td.style.color = "#FF0000";
			tr.appendChild(td);
		}
		tbody.appendChild(tr);
	}
	table.appendChild(tbody);
	dbody.appendChild(table);
}